package com.ujson.chat.server.builder;

import com.ujson.chat.common.proto.MessageProto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <h3>ujson-parent</h3>
 * <p>心跳响应消息构造器</p>
 *
 * @author JerryLiu  a1031757312@gmail.com
 * @version 1.0
 * @date 2021-11-26 19:45
 */
@Slf4j
@Service
public class HeartbeatResponseBuilder {
    public MessageProto.Message build(long sequence) {
        return MessageProto.Message.newBuilder()
                .setType(MessageProto.MessageType.KEEPALIVE_RESPONSE)
                .setSequence(sequence)
                .build();
    }
}
